# -*- coding: utf-8 -*-
from django.db import models


class FlujoCajaManager(models.Manager):
    
    
    def get_last_balance(self, usuario):
        
        try:
            valor = self.filter(usuario=usuario).latest()
            saldo_actual = int(valor.saldo)
        except:
            saldo_actual = 0
            
        return saldo_actual
